Class CollectionBase<T>

Base class (abstract) for ICollection implementations.

Implements

IEnumerable<T>, System.Collections.IEnumerable, System.IFormattable, ICollectionValue<T>, IShowable

Bases

object, EnumerableBase<T>, CollectionValueBase<T>

Base of

ArrayBase<T>, ArrayList<T>, CircularQueue<T>, DirectedCollectionBase<T>, HashBag<T>, HashedArrayList<T>, HashedLinkedList<T>, HashSet<T>, LinkedList<T>, SequencedBase<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Field overview

isReadOnlyBase ,
itemequalityComparer ,
size ,
stamp

Event overview

CollectionChanged, Inherited from CollectionValueBase<T> ,
CollectionCleared, Inherited from CollectionValueBase<T> ,
ItemInserted, Inherited from CollectionValueBase<T> ,
ItemRemovedAt, Inherited from CollectionValueBase<T> ,
ItemsAdded, Inherited from CollectionValueBase<T> ,
ItemsRemoved, Inherited from CollectionValueBase<T>

Property overview

ActiveEvents, Inherited from CollectionValueBase<T> ,
Count ,
CountSpeed ,
EqualityComparer ,
IsEmpty ,
IsReadOnly ,
ListenableEvents, Inherited from CollectionValueBase<T> ,
SyncRoot

Constructor overview

CollectionBase<T>(System.Collections.Generic.IEqualityComparer<T> itemequalityComparer)

Method overview

All(Fun<T,bool> predicate), Inherited from CollectionValueBase<T> ,
Apply(Act<T> action), Inherited from CollectionValueBase<T> ,
checkRange(int start, int count) ,
Choose(), Inherited from CollectionValueBase<T> ,
ComputeHashCode(ICollectionValue<T> items, System.Collections.Generic.IEqualityComparer<T> itemequalityComparer) ,
CopyTo(T[] array, int index), Inherited from CollectionValueBase<T> ,
Equals(object obj), Inherited from object ,
Exists(Fun<T,bool> predicate), Inherited from CollectionValueBase<T> ,
Filter(Fun<T,bool> predicate), Inherited from CollectionValueBase<T> ,
Finalize(), Inherited from object ,
Find(Fun<T,bool> predicate, out T item), Inherited from CollectionValueBase<T> ,
GetEnumerator() ,
GetHashCode(), Inherited from object ,
GetType(), Inherited from object ,
GetUnsequencedHashCode() ,
MemberwiseClone(), Inherited from object ,
modifycheck(int thestamp) ,
raiseCollectionChanged(), Inherited from CollectionValueBase<T> ,
raiseCollectionCleared(bool full, int count), Inherited from CollectionValueBase<T> ,
raiseCollectionCleared(bool full, int count, System.Nullable<int> offset), Inherited from CollectionValueBase<T> ,
raiseForAdd(T item), Inherited from CollectionValueBase<T> ,
raiseForInsert(int i, T item), Inherited from CollectionValueBase<T> ,
raiseForRemove(T item), Inherited from CollectionValueBase<T> ,
raiseForRemove(T item, int count), Inherited from CollectionValueBase<T> ,
raiseForRemoveAll(ICollectionValue<T> wasRemoved), Inherited from CollectionValueBase<T> ,
raiseForRemoveAt(int index, T item), Inherited from CollectionValueBase<T> ,
raiseForSetThis(int index, T value, T item), Inherited from CollectionValueBase<T> ,
raiseForUpdate(T newitem, T olditem), Inherited from CollectionValueBase<T> ,
raiseForUpdate(T newitem, T olditem, int count), Inherited from CollectionValueBase<T> ,
raiseItemInserted(T item, int index), Inherited from CollectionValueBase<T> ,
raiseItemRemovedAt(T item, int index), Inherited from CollectionValueBase<T> ,
raiseItemsAdded(T item, int count), Inherited from CollectionValueBase<T> ,
raiseItemsRemoved(T item, int count), Inherited from CollectionValueBase<T> ,
Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider), Inherited from CollectionValueBase<T> ,
StaticEquals(ICollection<T> collection1, ICollection<T> collection2, System.Collections.Generic.IEqualityComparer<T> itemequalityComparer) ,
ToArray(), Inherited from CollectionValueBase<T> ,
ToString(string format, System.IFormatProvider formatProvider), Inherited from CollectionValueBase<T> ,
ToString(), Inherited from CollectionValueBase<T> ,
UnsequencedEquals(ICollection<T> otherCollection) ,
updatecheck()

Field details

P bool isReadOnlyBase The underlying field of the ReadOnly property
P System.Collections.Generic.IEqualityComparer<T> itemequalityComparer The item equalityComparer of the collection
P int size The number of items in the collection
P int stamp The current stamp value

Property details

int CountAccess: Read-Only

Value:The size of this collection

Speed CountSpeedAccess: Read-Only

Value:A characterization of the speed of the Count property in this collection.

The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
System.Collections.Generic.IEqualityComparer<T> EqualityComparerAccess: Read-Only

Value:

bool IsEmptyAccess: Read-Only

Value:True if this collection is empty

bool IsReadOnlyAccess: Read-Only

Value:True if this collection is read only

object SyncRootAccess: Read-Only

Value:A distinguished object to use for locking to synchronize multithreaded access

Constructor details

PCollectionBase<T>(System.Collections.Generic.IEqualityComparer<T> itemequalityComparer)
Parameters:
itemequalityComparer:

Method details

NP void checkRange(int start, int count) Utility method for range checking.
Throws
System.ArgumentOutOfRangeException if the start or count is negative or if the range does not fit within collection size.
Parameters:
start:start of range
count:size of range
S int ComputeHashCode(ICollectionValue<T> items, System.Collections.Generic.IEqualityComparer<T> itemequalityComparer) Compute the unsequenced hash code of a collection
Returns:The hash code
Parameters:
items:The collection to compute hash code for
itemequalityComparer:The item equalityComparer
A System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this collection.
Returns:The enumerator
int GetUnsequencedHashCode() Get the unsequenced collection hash code of this collection: from the cached value if present and up to date, else (re)compute.
Returns:The hash code
P void modifycheck(int thestamp) Check if the collection has been modified since a specified time, expressed as a stamp value.
Throws
CollectionModifiedException if this collection has been updated since a target time
Parameters:
thestamp:The stamp identifying the target time
S bool StaticEquals(ICollection<T> collection1, ICollection<T> collection2, System.Collections.Generic.IEqualityComparer<T> itemequalityComparer) Examine if tit and tat are equal as unsequenced collections using the specified item equalityComparer (assumed compatible with the two collections).
Returns:True if equal
Parameters:
collection1:The first collection
collection2:The second collection
itemequalityComparer:The item equalityComparer to use for comparison
bool UnsequencedEquals(ICollection<T> otherCollection) Check if the contents of that is equal to the contents of this in the unsequenced sense. Using the item equalityComparer of this collection. Assuming that the item EqualityComparer is compatible with otherCollection!
Returns:True if equal
Parameters:
otherCollection:The collection to compare to.
P void updatecheck() Check if it is valid to perform update operations, and if so increment stamp.
Throws
ReadOnlyCollectionExceptionIf colection is read-only